/*
 * Copyright (c) 2018-2025, duneng All rights reserved.
 *
 * Author: wq (meteor85@163.com)
 */
import request from '@/router/axios'

export function addObj(obj) {
    return request({
        url: 'admin/industry/add/',
        method: 'post',
        data: obj
    })
}

export function fetchList(query) {
    return request({
        url: 'admin/industry/industryPage',
        method: 'get',
        params: query
    })
}

export function getObj(id) {
    return request({
        url: 'admin/industry/'+id,
        method: 'get',
    })
}

export function getListByCityId(id) {
    return request({
        url: 'admin/industry/cityId/'+id,
        method: 'get',
    })
}

export function getObjByProvinceAndCityId(obj) {
    return request({
        url: '/admin/industry/getByProvinceIdCityId',
        method: 'get',
        params:{
            provinceId:obj.provinceId,
            cityId:obj.cityId
        }
    })
}

export function putObj(obj) {
    return request({
        url: '/admin/industry/edit',
        method: 'put',
        data: obj
    })
}

export function delObj(id) {
    return request({
        url: '/admin/industry/' + id,
        method: 'delete'
    })
}

/*
*industryType: 0:虚拟  1：真实
*/
export function getIndustryByUserPermission(industryType){
    return request({
        url:'/admin/industry/getIndustryByUserPermission',
        method:'get',
        params:{
            industryType:industryType
        }
    })
}

/**
 * 根据燃气焓值及蒸汽焓值估算效益
 * @param {燃气热值} gasCalorific 
 * @param {蒸汽焓值} steamEnthalpy 
 */
export function getIndustryECEP(gasCalorific,steamEnthalpy){
    return request({
        url:'/admin/industry/getIndustryECEP',
        method:'get',
        params:{
            gasCalorific:gasCalorific,
            steamEnthalpy:steamEnthalpy,
        }
    })
}

